#! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Mosson"
# xadmin 的配置
import xadmin
from xadmin import views

class BaseSettings(object):
    """ xadmin 的基本配置"""
    enable_themes = True # 开启主题切换的功能
    use_bootswatch = True

xadmin.site.register(views.BaseAdminView, BaseSettings)


class GlobalSettings(object):
    """ xadmin 的全局配置"""
    site_title = "路飞" # 站点标题
    site_footer = "北京路飞学城科技有限公司"  # 站点页脚
    menu_style = "accordion" # 菜单折叠

xadmin.site.register(views.CommAdminView, GlobalSettings)

# 轮播图
from .models import Banner
class BannerModelAdmin(object):
    list_display = ["title", "orders", "is_show"]

xadmin.site.register(Banner, BannerModelAdmin)

# 导航菜单
from .models import Nav
class NavModelAdmin(object):
    list_display = ["title", "link", "position", "is_show", "is_site"]

xadmin.site.register(Nav, NavModelAdmin)


